<?php
require_once 'LoanMasters.php';
require_once '../application/modules/sponsor/models/DonationAllocations.php';

class Loan_LoanMasterController extends HTech_Controller_Action
{
    function init()
    {
        $cfg = array(
            'model' => 'LoanMasters',
            'actionContext' => array(
                'view' => array('prn','mob')),
            //'form' => 'Emms_Form_Loan_LoanMaster',
            //'config' => array('add' => 'loan_masters'),
            //'redirect' => 'add',
            //'flashMessenger' => true
        );
        parent::init($cfg);   
    }
    
    public function viewAction() 
    {
        parent::viewAction();
        
        try {
            $this->view->App = new Emms_LoanApplication((int) $this->_request->getParam('id'));
        } catch (Exception $e) {
            $this->getHelper('flashMessenger')->addMessage($e->getMessage());
            $this->redirect('/default/auth/deny'); 
        }
        $this->view->Menu = new Emms_LoanStatus($this->view->LoanMasters->d->Status);
    }
}
